@import '../../theme/static/theme.less';

@search-icon-color: #ced4d9;

#search-box {
  position: relative;
  display: flex;
  flex: auto !important;
  align-items: center;
  height: 22px;
  margin: 0 auto 0 0 !important;
  padding-left: 16px;
  line-height: 22px;
  white-space: nowrap;
  border-left: 1px solid @site-border-color-split;
  transition: width 0.5s;

  .ant-row-rtl & {
    margin: 0 0 0 auto !important;
    padding-right: 16px;
    padding-left: 0;
    border-right: 1px solid @site-border-color-split;
    border-left: none;
  }

  > * {
    flex: auto;
  }

  .anticon {
    position: absolute;
    top: 50%;
    z-index: 1;
    flex: none;
    color: @search-icon-color;
    transform: translateY(-50%);
    pointer-events: none;
  }

  input {
    width: 100%;
    max-width: 200px;
    padding-left: 20px;
    font-size: 14px;
    background: transparent;
    border: 0;
    box-shadow: none;

    .ant-row-rtl & {
      padding-right: 20px;
      padding-left: 11px;
    }

    &::placeholder {
      color: #a3b1bf;
    }
  }

  // ================ Narrow ================
  &.narrow-mode {
    flex: none !important;
    width: 30px;

    &:hover {
      .anticon {
        color: #a3b1bf;
      }
    }

    .anticon {
      right: 0;
      left: auto;

      .ant-row-rtl & {
        right: auto;
        left: 0;
      }
    }

    input {
      max-width: none;
      padding-right: 20px;
      padding-left: 11px;
      cursor: pointer;

      .ant-row-rtl & {
        padding-right: 11px;
        padding-left: 20px;
      }
    }

    &.focused {
      width: 500px;

      .anticon {
        color: @search-icon-color;
      }

      input {
        cursor: text;
      }
    }
  }
}

.component-select {
  &.ant-select-dropdown {
    font-size: 14px;
    border: 0;
    border-radius: 0;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.25);
  }
  .ant-select-dropdown-menu {
    max-height: 200px;
  }
  .ant-select-dropdown-menu-item {
    border-radius: 0 !important;
  }
  .ant-component-decs {
    position: absolute;
    right: 16px;
    color: #aaa;
    font-size: 12px;

    .ant-row-rtl & {
      right: auto;
      left: 16px;
    }
  }
}

@media only screen and (max-width: @mobile-max-width) {
  #search-box {
    display: none;
  }
}
